package week7.example;

//************************************************************************************************
//  Dictionary2.java     Author:Duanzhixuan
//
//   Represents a dicyionary, which is a book. Used to demonstrate the use of the super reference.
//*************************************************************************************************
public class Dictionary2 extends Book2 {
    private int definitions;
    //--------------------------------------------------------------------------------------
    //  Constructer: Sets up the dictionary with the specified number of pages and definitions.
    //---------------------------------------------------------------------------------------
    public Dictionary2(int numPages,int numDefinitions)
    {
        super(numPages);
    definitions = numDefinitions;
    }
//-------------------------------------------------------------------------------------------------
//  Ptrints a message using both local and inherited values.
//-------------------------------------------------------------------------------------------------
public double computeRatio()
{
    return (double) definitions/pages;
}
//--------------------------------------------------------------------------------------------------
//   Definitions mutator.
//-------------------------------------------------------------------------------------------------
public void setDefinitions(int numDefitions)
{
    definitions = numDefitions;
}
//-----------------------------------------------------------------------------------------
//  Definitions accessor.
//-----------------------------------------------------------------------------------------------
public int getDefinitions()
{
    return definitions;
}


}
